package cn.tedu.st.security.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @PostMapping("/user/select")
    @PreAuthorize("hasAnyAuthority('sys:user:select')")
    public String userSelect(){
        return "查找用户";
    }

    @PostMapping("/user/update")
    @PreAuthorize("hasAnyAuthority('sys:user:update')")
    public String userUpdate(){
        return "更新用户";
    }

    @PostMapping("/user/insert")
    @PreAuthorize("hasAnyAuthority('sys:user:insert')")
    public String userInsert(){
        return "添加用户";
    }


    @PostMapping("/user/delete")
    @PreAuthorize("hasAnyAuthority('sys:user:delete')")
    public String userDelete(){
        return "删除用户";
    }

}
